Skip to content

fix(doclang): serialize the footnotes of a track - #1095

Open
shashank11yadav wants to merge 1 commit into
docling-project:mainfrom
shashank11yadav:fix/track-footnotes
Open

shashank11yadav wants to merge 1 commit into
docling-project:mainfrom
shashank11yadav:fix/track-footnotes

Conversation

@shashank11yadav

Copy link
Copy Markdown

Fixes #1094

The DocLang serializer wrote the footnotes of pictures, tables and code, but not the footnotes listed in a track's footnotes. The body walk skipped them as satellites, so they were missing from the output.

This change writes them next to the track in an unnamed <group>, the same shape already used for pictures, tables and code. The deserializer reads that group back and re-attaches the footnotes to the track.

DocLang has no dedicated element for float footnotes, so this reuses the <group> convention. Maintainers may prefer another shape for tracks.

Testing:

  • The five DocLang test files that cover this change (track, track round-trip, deserializer, serialization, deserializer source mapping): 481 passed, 52 xfailed.
  • New tests: a track footnote test in tests/test_doclang_track.py and a track_footnote round-trip case in the pretty and compact variants. With the fix reverted, the three new tests fail.
  • Ruff lint, ruff format check and ty check over the repo's usual directories: all pass (ty reports warnings only, no errors).
  • Not run: the pre-commit hooks (prek) and the full test suite.

The DocLang serializer wrote the footnotes of pictures, tables and code,
but dropped the ones listed in a track's footnotes. Write them next to the
track in an unnamed group, as for the other floating items, and read that
group back so the footnotes are re-attached to the track.

Signed-off-by: Shashank Yadav <65058495+shashank11yadav@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

✅ DCO Check Passed

Thanks @shashank11yadav, all your commits are properly signed off. 🎉

@mergify

mergify Bot commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🔴 1 of 2 protections blocking · waiting on 👀 reviews

Protection Waiting on
🔴 Require two reviewer for test updates 👀 reviews
🟢 Enforce conventional commit —

🔴 Require two reviewer for test updates

Waiting for

  • #approved-reviews-by >= 2
This rule is failing.

When test data is updated, we require two reviewers

  • #approved-reviews-by >= 2

Show 1 satisfied protection

🟢 Enforce conventional commit

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?(!)?:

@github-actions github-actions Bot added bug Something isn't working doclang DocLang / DCLX serialization and deserialization labels Nov 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

AI triage (advisory)

Checked commit 1214cbc33e. The analysis read the diff only. It did not run code from this pull request.

Warning

The AI analysis did not finish. Only the deterministic checks are shown.

Topic labels added: bug, doclang.

CI safety: not assessed.

Possibly related pull requests

PR State Signal Assessment
#878 open changes the same code not assessed
#838 open changes the same code not assessed

The ai:* labels are advisory. They do not approve CI and they do not add tests:full. A new push runs this check again.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working doclang DocLang / DCLX serialization and deserialization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(doclang): footnotes of a TrackItem are not serialized

1 participant